home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7847 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.5 KB

  1. Path: library.erc.clarkson.edu!rpi!not-for-mail
  2. From: Tony Houghton <tonyh@tcp.co.uk>
  3. Newsgroups: comp.lang.c++.moderated,comp.lang.c
  4. Subject: Re: Tool for removing surplus #includes
  5. Date: 28 Feb 1996 22:28:08 -0000
  6. Organization: UWL
  7. Sender: cppmods@netlab.cs.rpi.edu
  8. Approved: vandevod@cs.rpi.edu
  9. Message-ID: <4h2kto$c9k@netlab.cs.rpi.edu>
  10. References: <4gj0p3$lp0@solutions.solon.com> <4gum81$hlk@netlab.cs.rpi.edu>
  11. NNTP-Posting-Host: netlab.cs.rpi.edu
  12. X-Original-Date: Wed, 28 Feb 1996 20:53:20 +0000
  13.  
  14. In article <4gum81$hlk@netlab.cs.rpi.edu>
  15.           nababs@qualcomm.com (Nasser Abbasi) wrote:
  16.  
  17. > In article <4gj0p3$lp0@solutions.solon.com>, tonyh@tcp.co.uk says...
  18. > >
  19. > >Does anyone know of a PD tool available with portable(ish) source for
  20. > >removing surplus #include directives? For example:
  21. > >
  22. > >/* "file2.h" */
  23. > >#include "file1.h"
  24. > >
  25. > >-------------------
  26. > >
  27. > >/* "file3.h" */
  28. > >#include "file1.h"
  29. > >#include "file2.h"
  30. > >
  31. > >-------------------
  32. > >
  33. > >#include "file1.h" could be removed from "file3.h". This sort of thing
  34. > >saves a lot of compiler time without having the chore of typing:
  35. > >
  36. > >#ifndef __file1_h
  37. > >#include "file1.h"
  38. > >#endif
  39. > >
  40. > So, you mean that in the future if you decide that file2.h do not
  41. > need to include file1.h any more, you have to somehow remember 
  42. > to go back to file3.h and add a line to include file1.h, since may
  43. > be file3.h needs file1.h but file2.h do not need file1.h
  44. > Having to deal with these sort of things will most likley be not worth
  45. > the effort. Also remember that all this work with including .h files
  46. > is done by the pre-processor, not by the compiler itself.
  47.  
  48. I think I'm inclined to agree with you now, but I don't understand your
  49. point about the work being done by the preprocessor, not the compiler.
  50. I'll stick to surrounding each include with an #ifndef.
  51.  
  52. > I think you are trying to save few nanoseconds here from the 
  53. > pre-processor time
  54.  
  55. It takes more than nanoseconds.
  56.  
  57. -- 
  58. Tony Houghton                     tonyh@tcp.co.uk
  59. Using an Acorn RiscPC 700         http://www.tcp.co.uk/~tonyh/
  60. No Intel inside, no Microsoftware. A computer, not a cartel.
  61. ----------------------------------------------------------------
  62. The Internet is a most invaluable resource for Internet software
  63.  
  64.       [ Articles to moderate: mailto:c++-submit@netlab.cs.rpi.edu ]
  65.       [  Read the C++ FAQ: http://www.connobj.com/cpp/cppfaq.htm  ]
  66.       [  Moderation policy: http://www.connobj.com/cpp/guide.htm  ]
  67.       [      Comments? mailto:c++-request@netlab.cs.rpi.edu       ]
  68.